package 狂神;
import javax.swing.*;
import java.util.Scanner;

/**
 * @ClassName: calulator02
 * @Auther: Drawin
 * @Date: 2021/11/13 22:59
 * @Description:除法缺少分母为零的情况，会输出infinity
 */

public class calulator02 {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入计算方式:");
            String jisuantype = scanner.next();
            System.out.println("值1:");
            double next = scanner.nextDouble();
            System.out.println("值2:");
            double next1 = scanner.nextDouble();
            switch (jisuantype) {
                case "+":
                    System.out.println(next + next1);
                    break;
                case "-":
                    System.out.println(next - next1);
                    break;
                case "*":
                    System.out.println(next * next1);
                    break;
                case "/":
                    System.out.println(next / next1);
                    break;
            }
            scanner.close();
        }
    }
